home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / perl / os2perl / package.t < prev    next >
Text File  |  1991-04-12  |  714b  |  34 lines

  1. #!./perl
  2.  
  3. print "1..7\n";
  4.  
  5. $blurfl = 123;
  6. $foo = 3;
  7.  
  8. package XYZ;
  9.  
  10. $bar = 4;
  11.  
  12. {
  13.     package ABC;
  14.     $blurfl = 5;
  15.     $main'a = $'b;
  16. }
  17.  
  18. $ABC'dyick = 6;
  19.  
  20. $xyz = 2;
  21.  
  22. $main = join(':', sort(keys _main));
  23. $XYZ = join(':', sort(keys _XYZ));
  24. $ABC = join(':', sort(keys _ABC));
  25.  
  26. print $XYZ eq 'ABC:XYZ:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$XYZ'\n";
  27. print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2\n";
  28. print $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
  29. package ABC;
  30. print $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
  31. eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
  32. eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';
  33. print $blurfl == 5 ? "ok 7\n" : "not ok 7\n";
  34.